Release 10.1A: OpenEdge Development:
Progress 4GL Reference


– Date subtraction operator

Subtracts a number of days from a date to produce a date result, or subtracts one date from another to produce an integer result that represents the number of days between the two dates.

Syntax

date - { days | date } 

date

An expression that evaluates to a DATE value.

days

An expression with a value of the number of days you want to subtract from a date.

Example

This procedure finds all unshipped orders. If the promised date is more than one week ago, the procedure finds the customers who placed the order and displays the order and customer data.

r-dsub.p
DISPLAY "ORDERS SCHEDULED TO SHIP MORE THAN ONE WEEK LATE".
FOR EACH order WHERE ship-date = ?:
  IF (TODAY - 7) > promise-date
  THEN DISPLAY order.order-num order.cust-num promise-date
    (TODAY - promise-date) LABEL "Days Late".
END. 

Notes


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095